package com.lhj.bootdemo.thread;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import java.util.HashMap;
import java.util.Map;

/**
 * @author lhj
 * @version 1.0
 * @date 2022/4/25 4:29 下午
 * @description:
 */
@Component
public class MyRunnable  implements  Runnable{

    @Autowired
    private ThreadService threadService;

    private Map<String, String > map = new HashMap<>();
    @Override
    public void run() {
        Thread.currentThread().setName("线程@@@@@@号");
        System.out.println("当前线程的名字："+Thread.currentThread().getName());
        threadService.Hello(map);
    }


    public Map<String, String> getMap() {
        return map;
    }

    public void setMap(Map<String, String> map) {
        this.map = map;
    }
}
